<template>
    <el-dialog
    title="新增"
    :visible="isShowAddDialog"
    @close="dialogClose"
      >
    <el-form :model="ruleForm" :rules="rules" ref="serviceChargeAddForm" label-width="100px">

      <el-row :gutter="24">
          <el-col :span="12">
              <el-form-item label="订单编号" prop="orderId">
                  <el-input v-model="ruleForm.orderId" readonly="readonly"></el-input>
              </el-form-item>
          </el-col>
      </el-row>

      <el-row :gutter="24">
          <el-col :span="12">
              <el-form-item label="生成时间" prop="time">
                  <el-input v-model="ruleForm.time"></el-input>
              </el-form-item>
          </el-col>
          <el-col :span="12">
              <el-form-item label="结算周期" prop="settlementCycle">
                  <el-input v-model="ruleForm.settlementCycle"></el-input>
              </el-form-item>
          </el-col>
      </el-row>

      <el-row :gutter="24">
          <el-col :span="12">
              <el-form-item label="订单总额" prop="totalPrice">
                  <el-input v-model="ruleForm.totalPrice"></el-input>
              </el-form-item>
          </el-col>
          <el-col :span="12">
              <el-form-item label="缴纳状态" prop="paymentState">
                  <el-select class="select" v-model="ruleForm.paymentState"></el-select>
              </el-form-item>
          </el-col>
      </el-row>

    </el-form>
  
    <span style="display: flex;">
          <div style="flex: 1"></div>
        <el-button @click="dialogClose">取 消</el-button>
        <el-button type="primary" @click="submitData">确 定</el-button>
    </span>
  
  </el-dialog>
  
  </template>
  
  <script>
  export default {
      data(){
          return{
              ruleForm: {
                  orderId: '',
                  time: '',
                  settlementCycle: '',
                  totalPrice: '',
                  paymentState: '',
              },
              rules:{
                  time:[
                      {required: true, message: '请输入'}
                  ],
                  settlementCycle:[
                      {required: true, message: '请输入'}
                  ],
                  totalPrice:[
                      {required: true, message: '请输入'}
                  ],
                  paymentState:[
                      {required: true, message: '请选择'}
                  ],
              }
          }
      },
      props:{
          isShowAddDialog:{
              type:Boolean
          },
      },
      methods: {
          dialogClose(){ 
              this.$emit('dialogClose');
          },
          submitData(){
            this.$refs.serviceChargeAddForm.validate((valid) => {
                if (!valid) {
                    return
                }
                else {
                    this.$emit('dialogClose')
                }
            });
        },
  
      }
  }
  </script>
  
  <style scoped lang="less">
    .select{
          width: 100%;
      }
  </style>
  
  